package com.nstar.model.orderexpress;

import java.io.Serializable;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;


/** 
 *        @hibernate.class
 *         table="repository"
 *     
*/
public class Repository implements Serializable {

    /** identifier field */
    private Integer seq;

    /** nullable persistent field */
    private String holidayDesc;

    /** identifier field */
    private com.nstar.model.orderexpress.Holiday holiday;

    /** persistent field */
    private com.nstar.model.orderexpress.RepositoryType repositoryType;

    /** full constructor */
    public Repository(Integer seq, String holidayDesc, com.nstar.model.orderexpress.Holiday holiday, com.nstar.model.orderexpress.RepositoryType repositoryType) {
        this.seq = seq;
        this.holidayDesc = holidayDesc;
        this.holiday = holiday;
        this.repositoryType = repositoryType;
    }

    /** default constructor */
    public Repository() {
    }

    /** minimal constructor */
    public Repository(Integer seq, com.nstar.model.orderexpress.Holiday holiday, com.nstar.model.orderexpress.RepositoryType repositoryType) {
        this.seq = seq;
        this.holiday = holiday;
        this.repositoryType = repositoryType;
    }

    /** 
     *                @hibernate.property
     *                 column="SEQ"
     *                 length="4"
     *             
     */
    public Integer getSeq() {
        return this.seq;
    }

    public void setSeq(Integer seq) {
        this.seq = seq;
    }

    /** 
     *            @hibernate.property
     *             column="HOLIDAY_DESC"
     *             length="255"
     *         
     */
    public String getHolidayDesc() {
        return this.holidayDesc;
    }

    public void setHolidayDesc(String holidayDesc) {
        this.holidayDesc = holidayDesc;
    }

    /** 
     *                @hibernate.many-to-one
     *             
     *                @hibernate.column
     *                 name="HOLIDAY_ID"
     *             
     */
    public com.nstar.model.orderexpress.Holiday getHoliday() {
        return this.holiday;
    }

    public void setHoliday(com.nstar.model.orderexpress.Holiday holiday) {
        this.holiday = holiday;
    }

    /** 
     *            @hibernate.many-to-one
     *             not-null="true"
     *            @hibernate.column name="REP_ID"         
     *         
     */
    public com.nstar.model.orderexpress.RepositoryType getRepositoryType() {
        return this.repositoryType;
    }

    public void setRepositoryType(com.nstar.model.orderexpress.RepositoryType repositoryType) {
        this.repositoryType = repositoryType;
    }

    public String toString() {
        return new ToStringBuilder(this)
            .append("seq", getSeq())
            .append("holiday", getHoliday())
            .toString();
    }

    public boolean equals(Object other) {
        if ( (this == other ) ) return true;
        if ( !(other instanceof Repository) ) return false;
        Repository castOther = (Repository) other;
        return new EqualsBuilder()
            .append(this.getSeq(), castOther.getSeq())
            .append(this.getHoliday(), castOther.getHoliday())
            .isEquals();
    }

    public int hashCode() {
        return new HashCodeBuilder()
            .append(getSeq())
            .append(getHoliday())
            .toHashCode();
    }

}
